﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CQIE.TES.Model;
using CQIE.TES.WEB.USER.Models;

namespace CQIE.TES.IDAL
{
    public interface IRecordDAL
    {
        /// <summary>
        /// 保存学生评教结果
        /// </summary>
        /// <param name="evaId"></param>
        /// <param name="teacherid"></param>
        /// <param name="courseId"></param>
        /// <param name="studentId"></param>
        /// <param name="answerList"></param>
        /// <param name="question"></param>
        /// <returns></returns>
        bool SaveStudentRecord(int evaId, int teacherid, int courseId, int studentId, List<int> answerList, List<int> question);

        /// <summary>
        /// 判断学生是否已完成该评测
        /// </summary>
        /// <param name="evaid"></param>
        /// <param name="teacherid"></param>
        /// <param name="courseId"></param>
        /// <param name="sid"></param>
        /// <returns>null未完成 完成会返回结果</returns>
        List<Record> IsRecorded(int evaid, int teacherid, int courseId, string studentCode);

        /// <summary>
        /// 判断系部 教研室是否完成评教
        /// </summary>
        /// <param name="evaId"></param>
        /// <param name="teacherId"></param>
        /// <param name="aimTeacherId"></param>
        /// <returns></returns>
        List<Record> IsRecorded(int evaId, Teacher teacher, int aimTeacherId,ENUM_EVA_TYPE mode);

        /// <summary>
        /// 判断教师自评是否完成评教
        /// </summary>
        /// <param name="evaId"></param>
        /// <param name="teacherCode"></param>
        /// <returns></returns>
        List<Record> IsRecorded(int evaId, Teacher teacher);

        /// <summary>
        /// 保存系部评教结果
        /// </summary>
        /// <param name="evaId"></param>
        /// <param name="teacherId"></param>
        /// <param name="aimTeacherID"></param>
        /// <param name="answerList"></param>
        /// <param name="questionList"></param>
        /// <param name="mode"></param>
        /// <param name="aimTeacherWorkNumber"></param>
        /// <returns></returns>
        bool SaveDepartmentRecord(int evaId, string teacherId, int aimTeacherID, List<int> answerList,
            List<int> questionList, ENUM_EVA_TYPE mode);

        /// <summary>
        /// 保存教师互评结果
        /// </summary>
        /// <param name="evaId"></param>
        /// <param name="teacherId"></param>
        /// <param name="aimTeacherId"></param>
        /// <param name="answerList"></param>
        /// <param name="questionList"></param>
        /// <returns></returns>
        bool SaveTeacherOtherRecord(int evaId, string teacherId, int aimTeacherId, List<int> answerList, List<int> questionList);

        /// <summary>
        /// 保存教师自评结果
        /// </summary>
        /// <param name="evaId"></param>
        /// <param name="id"></param>
        /// <param name="teacherId"></param>
        /// <param name="answerList"></param>
        /// <param name="questionList"></param>
        /// <returns></returns>
        bool SaveTeacherSelfRecord(int evaId, int teacherId, string teacherNum, List<int> answerList, List<int> questionList);

        /// <summary>
        /// 获取所有教师 某一学年的总分
        /// </summary>
        /// <param name="studyYearId"></param>
        /// <returns></returns>
        ///List<Teacher> GetLeaveCount(int studyYearId);


        /// <summary>
        /// 获取教师被评教记录
        /// </summary>
        /// <param name="teacherId"></param>
        /// <param name="courseId"></param>
        /// <param name="studyYearId"></param>
        /// <returns></returns>
        List<Record> GetTeacherRecord(int teacherId, int? courseId = null, int? studyYearId = null);

        /// <summary>
        /// 获取教师学年综合评教走势
        /// </summary>
        /// <param name="teacherId"></param>
        /// <returns></returns>
        List<double> GetTeacherScoreTrend(int teacherId);

        /// <summary>
        /// 获取班级对教师的评教   左上
        /// </summary>
        /// <param name="teacherId"></param>
        /// <returns></returns>
        object GetClassScore(int teacherId);

        /// <summary>
        /// 获取教师某种类型的等级次数
        /// </summary>
        /// <param name="teacherId"></param>
        /// <param name="type"></param>
        /// <returns>[{name:优秀,value:15}]</returns>
        object CalcEvaTypeNum(int teacherId, ENUM_EVA_TYPE type);

        /// <summary>
        /// 查询老师课程评教成绩
        /// </summary>
        /// <param name="tid"></param>
        /// <returns></returns>
        object GetCourseGrade(int tid);

        object GetEvaTrend();

        /// <summary>
        /// 获取table中的数据
        /// </summary>
        /// <param name="limit"></param>
        /// <param name="page"></param>
        /// <param name="searchString"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        object GetTableData(int limit, int page, string searchString, out int count);
    }
}
